<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     base_default
 */
?>

<?php
/**
 * Template for displaying product price at catalog and sidebars
 *
 * @var Mage_Catalog_Block_Product_Price $this
 */
?>
<?php
    /** @var Mage_Catalog_Model_Product $_product */
    $_product = $this->getProduct();
    $_msrpPrice = "";
?>
    <div class="price-box map-info">
    <?php $_price = $this->helper('tax')->getPrice($_product, $_product->getMsrp()) ?>
        <?php if ($_product->getMsrp()): ?>
            <?php $_msrpPrice = $this->helper('core')->currency($_product->getMsrp(),true,true) ?>
            <span class="old-price" id="product-price-<?php echo $_product->getId() ?><?php echo $this->getIdSuffix() ?>"><?php echo $_msrpPrice ?></span>
        <?php endif ?>
        <?php $helpLinkId = 'msrp-click-' . $_product->getId() . $this->helper('core')->getRandomString(20); ?>
        <a href="#" class="map-link" id="<?php echo($helpLinkId);?>"><?php echo $this->__('Click for price') ?></a>
        <script type="text/javascript">
            <?php if ($this->helper('catalog')->isShowPriceOnGesture($_product)): ?>
                var newLink = Catalog.Map.addHelpLink(
                        $('<?php echo $helpLinkId ?>'),
                        "<?php echo $this->escapeHtml($_product->getName()) ?>",
                        <?php echo $this->getRealPriceJs($_product) ?>,
                        '<?php echo $_msrpPrice ?>',
                        "<?php echo $_product->isSalable() ? $this->getAddToCartUrlCustom($_product, [], false) : '' ?>"
                );
                newLink.product_id = '<?php echo $_product->getId() ?>';
            <?php else: ?>
                Catalog.Map.addHelpLink(
                        $('<?php echo $helpLinkId ?>'),
                        "<?php echo $this->escapeHtml($_product->getName()) ?>",
                        null,
                        null,
                        "<?php echo $_product->getProductUrl() ?>"
                );
            <?php endif ?>

        </script>
    </div>
